In order to read a document using a scanner or the like and store it as image data, it is necessary to accurately detect a document region in the read image. In a flatbed-type or automatic document feeding-type scanner in general, a document region can be easily distinguished from the other regions using a backing of a monotone color such as white, black, and the like. On the other hand, overhead scanners, which read a document placed on a desk or the like, are currently being used and the capability of accurately distinguishing between a pattern on a desk and a document is required of such scanners.
Overhead scanners are sometimes used for scanning a photograph affixed on a page of an album in which photographs can be affixed on self-adhesive pages. In such a case, it is necessary to accurately distinguish between a region of the page in which a stripe pattern of deteriorated glue appears and the photograph.
An image reading apparatus that obtains a document region from a read image has been disclosed. The image reading apparatus determines a method for cutting out a document region based on degree of coincidence between apex coordinates of a first rectangle region including all subjects and apex coordinates of a second rectangle region including all subjects determined as contents of the document among all of the subjects and having the smallest area (see Japanese Laid-open Patent Publication No. 2009-272676).
An image reading apparatus that generates reference data for detecting document edges using image data in a region in which a baking part appears across the full width of the region and obtains a difference between the reference data and image data to detect edges of a document has been disclosed. The image reading apparatus performs edge detection in given lines in the horizontal and vertical directions to detect the four sides of the document, thereby automatically recognizing the document image (see Japanese Laid-open Patent Publication No. 2007-88654).
An image processing apparatus that detects a boundary of a document in an input image has been disclosed. The image processing apparatus extracts edge pixels from an input image, extracts a plurality of straight lines from the edge pixels, extracts candidate rectangle regions from the extracted straight lines, and selects a rectangle region based on the number of edge pixels that are located within a predetermined distance from each side of each candidate rectangle region and the degree likelihood of being a corner of each possible corner (see Japanese Laid-open Patent Publication No. 2013-106160).
Furthermore, an image processing apparatus that determines a region in which an image of a document is cut out from a read image has been disclosed. The image processing apparatus detects a subject region in an input image and detects a rectangle region in the subject region. When the rectangle region matches the subject region, the image processing apparatus determines the rectangle region as the region to be cut out; when the rectangle region does not match the subject region, the image processing apparatus determines a region including the subject region as a region to be cut out (see Japanese Laid-open Patent Publication No. 2014-195148).